import store from '@/store'
import ChargeCarjson from './ChargeCar'
import defaultValue from './defaultValue'
let ChargeCartypejson = ChargeCarjson.ChargeCartypejson
let StationHD = [
  {
    label: '参数配置',
    type: 'b_edt1',
    text: '是否修改该站点已经存在的设备配置?',
    options: [
      { label: '防扰民', value: 'b_atyy', type: 'switch', defaultValue: '0' },
      { label: '充满自停', value: 'b_dd', type: 'switch', defaultValue: '0' },
      {
        label: '强制关注公众号',
        value: 'b_follow',
        type: 'switch',
        defaultValue: '0',
      },
      { label: '插拔检测', value: 'b_cbdd', type: 'switch', defaultValue: '0' },
      {
        label: '开始时间',
        value: 'ddsjs',
        dw: '时',
        if: {
          zhierror: [{ value: 'b_cbdd', zhi: ['1'] }],
        },
      },
      {
        label: '结束时间',
        value: 'ddsje',
        dw: '时',
        if: {
          zhierror: [{ value: 'b_cbdd', zhi: ['1'] }],
        },
      },
      { label: '涓流时长', value: 'fcsj', defaultValue: '0' },
    ],
  },
  {
    label: '收费模式',
    type: 'b_edt2',
    text: '是否修改该站点已经存在的设备的收费模式?',
    options: [
      {
        label: '收费模式',
        value: 'type',
        type: 'select',

        option: [...defaultValue.type],
        defaultValue: '2',
      },
      ...ChargeCartypejson,
    ],
  },
  { label: '全卡通设置', options: [{ value: 'printid', label: '全通卡卡号' }] },
  { label: '客服电话', options: [{ value: 'telfu1', label: '客服电话' }] },
  {
    label: '免费次数',
    type: '/StationCfgedt',
    options: [{ value: 'scmfcs', label: '免费次数', defaultValue: '0' }],
  },
]
if (store.state.user.token.utype == 4) {
  StationHD.push({
    label: '平台流量费',
    options: [{ value: 'llfptmr', label: '平台流量费', fl: '100', dw: '元' }],
  })
}
if (store.getters['upw/b_bxr']) {
  StationHD[0].options.push({
    label: '保险投放',
    value: 'b_bxr',
    defaultValue: '0',
    type: 'select',
    option: [
      { value: '0', label: '不投放' },
      { value: '1', label: '用户投放' },
      { value: '2', label: '代理商投放' },
    ],
  })
}
if (store.getters['upw/b_tel']) {
  StationHD[0].options.push({
    label: '电量校准',
    value: 'b_tel',
    defaultValue: '0',
    type: 'select',
    option: [
      { value: '0', label: '不减少' },
      { value: '1', label: '减少25%' },
      { value: '2', label: '减少30%' },
      { value: '3', label: '减少35%' },
      { value: '4', label: '减少40%' },
      { value: '6', label: '减少45%' },
      { value: '7', label: '减少75%' },
      { value: '5', label: '电量为0' },
    ],
  })
}

export default { StationHD }
